package com.westos.userauth.dao.impl;

import com.westos.userauth.dao.SecurityGroupDao;
import com.westos.userauth.dao.mybatis.SecurityGroupDAO;
import com.westos.userauth.domain.SecurityGroup;
import com.westos.userauth.domain.SecurityPermission;
import com.westos.userauth.domain.UserLoginSecurityGroup;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

/**
 * @Author liuhao
 * @Data 2020/11/15
 */
@Repository
public class MybatisSecurityGroupDao implements SecurityGroupDao {

    @Autowired
    private SecurityGroupDAO securityGroupDAO;
    @Override
    public int addSecurityPermissionToSecurityGroup(SecurityGroup securityGroup) {
        return 0;
    }

    @Override
    public int addUserLoginToSecurityGroup(UserLoginSecurityGroup userLoginSecurityGroup) {
        return securityGroupDAO.addUserLoginToSecurityGroup(userLoginSecurityGroup);
    }

    @Override
    public int createSecurityGroup(SecurityGroup securityGroup) {
        return securityGroupDAO.createSecurityGroup(securityGroup);
    }

    @Override
    public int deleteSecurityGroup(String groupId) {
        return securityGroupDAO.deleteSecurityGroup(groupId);
    }

    @Override //修改权限组
    public int updateSecurityGroup(SecurityGroup securityGroup) {
        return securityGroupDAO.updateSecurityGroup(securityGroup);
        //return 1;
    }

    @Override//查询权限组
    public SecurityGroup querySecurityGroupById(String securityGroupId) {
        return securityGroupDAO.querySecurityGroupById(securityGroupId);
    }

}
